"""webtool URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
# 前台大堂点餐子路由文件
from django.contrib import admin
from django.urls import path,include
from web.views import index,cart
urlpatterns = [
    path('', index.index,name="web_index_1"),

    #前端登录退出的路由
    path('login', index.login,name="web_login"), # 加载登录表单
    path('dologin', index.dologin,name="web_dologin"), # 执行登录
    path('logout', index.logout,name="web_logout"), # 退出
    path('verify', index.verify, name="web_verify"), #输出验证码

    #为url路由添加请求前缀web/,凡是带此前缀的url地址，必须登录后才可访问
    path("web/",include([
        path('', index.webindex,name="web_index"), #前台大堂点餐首页
        #购物车信息管理路由
        path('cart/add/<str:pid>',cart.add,name="web_cart_add"), #添加购物车
        path('cart/delete/<str:pid>',cart.delete,name="web_cart_delete"), #删除购物车
        path('cart/clear',cart.clear,name="web_cart_clear"), #清空购物车
        path('cart/change',cart.change,name="web_cart_change"), #更改购物车


    ]))


]